<?php

uses('Sanitize');

class VisitsController extends AppController
{
	var $name = 'Visits';
	var $uses = array('Visit');
	var $helpers = array('Html', 'Time');
	
	function index($showAll = 0)
   	{
	    $visits = $this->Visit->find('all', array(
		'order' => 'url DESC, created DESC, referer ASC',
		'conditions' => $showAll == 0 ? array("created >= '" . date('Y-m-d H:i:s', strtotime('-24 hours')) . "'") : null));
	    $this->set('title', 'Inbound links');
	    $this->set('visits', $visits);
   	}
}

?>
